﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MockupDesigner.Editors.TextEditors;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows;
using Microsoft.Windows.Controls;

namespace MockupDesigner.Items
{
    [SimpleTextEditor]
    public class LabelItem : ResizableItem, ITextItem
    {
        // Using a DependencyProperty as the backing store for Text.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(LabelItem), new UIPropertyMetadata(string.Empty));

        [Category("Prop_Content")]
        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set
            {
                if (this.Text == value) return;
                OnPropertyChanging("Text", this.Text, value);
                SetValue(TextProperty, value);
                OnPropertyChanged("Text");
            }
        }

        public static readonly DependencyProperty MultilineProperty =
           DependencyProperty.Register("Multiline", typeof(bool), typeof(LabelItem), new UIPropertyMetadata(false));

        [Category("Prop_Settings")]
        public bool Multiline
        {
            get { return (bool)GetValue(MultilineProperty); }
            set
            {
                if (this.Multiline == value) return;
                OnPropertyChanging("Multiline", this.Multiline, value);
                SetValue(MultilineProperty, value);
                OnPropertyChanged("Multiline");
            }
        }
        
    }
}
